from django.contrib.admin import ModelAdmin, StackedInline

from app.models.order import OrderProduct


class OrderProductInline(StackedInline):
    model = OrderProduct
    extra = 0


class OrderAdmin(ModelAdmin):
    list_display = ('id', 'user', 'sum', 'deposit', 'status', 'created_datetime', 'expired_datetime', 'address',
                    'delivery_datetime', 'delivery_deadline_datetime', 'remark', 'out_order_id', '销售', '支付方式')
    list_filter = ('user', 'status')
    inlines = (OrderProductInline, )
